﻿using System;
using System.Collections.Generic;
using System.Text;
using NUnit.Framework;
using NHibernateSample.Domain.Entities;

namespace NHibernateSample.Data.Test
{
    [TestFixture]
    public class QueryHqlFixture
    {
        private QueryHql sample;

        [TestFixtureSetUp]
        public void QueryHqlFixtureSetup()
        {
            sample = new QueryHql();
        }

        [Test]
        public void FromTest()
        {
            IList<Customer> list= sample.From();
            Assert.AreEqual("永京", list[0].LastName);
        }

        [Test]
        public void GetCustomersByFirstNameTest()
        {
            IList<Customer> list = sample.GetCustomersByFirstName("解");
            Assert.AreEqual("然",list[0].LastName);
        }

        [Test]
        public void GetCustomersWithCustomerIdLessThanTest()
        {
            IList<Customer> list = sample.GetCustomersWithCustomerIdLessThan(5);
            Assert.AreEqual(4,list.Count);
        }
    }

}
